{#继承父模板#}
{% extends 'common/base.html' %}

{% load staticfiles %}

{#标题#}
{% block title %}满分餐厅｜餐厅故事{% endblock title %}

{#头部js#}
{% include 'common/head_js.html' %}

{#页面主体#}
{% block body %}

{% for story in stories_now %}
<div class="main story_box">
    <div class="topics">
        <input type="hidden" name="story_id" value="{{ story.id }}">
        <div class="container">
            <a class="story_title_link" href="{% url 'stories:story' %}?id={{ story.id }}" target="_blank">
                <span>{{ story.story_title }}</span>
            </a>
            <span class="story-date hidden-xs">
                <time>{{ story.update_time }}</time>
            </span>
        </div>
    </div>
    <div class="container story_box1_desc">
        <div class="row community-top">
            <div class="col-md-5 col-sm-5 ">
                <img src="{% static story.story_img %}" class="img-responsive carousel-inner img-rounded" alt="">
            </div>
            <div class="col-md-7 col-sm-7 community_desc story_desc">
                <p>{{ story.story_desc|safe }}</p>
            </div>
            <div class="community_btn"><a href="{% url 'stories:story' %}?id={{ story.id }}" target="_blank">查看全文</a></div>
        </div>
    </div>
</div>
{% endfor %}


{# 小屏幕显示 #}
{% for story in stories_now %}
<div class="main story_box2">
    <input type="hidden" name="story_id" value="{{ story.id }}">
    <div class="container">
        <div class="row community-top">
            <div class="col-sm-8 col-sm-offset-2 col-xs-8 col-xs-offset-2">
                <img src="{% static story.story_img %}" class="img-responsive carousel-inner img-rounded" alt="">

                <a href="{% url 'stories:story' %}?id={{ story.id }}" target="_blank">
                <h3 class="title">{{ story.story_title }}</h3>
                </a>
                <h4 class="story-date2">
                    <time>{{ story.update_time }}</time>
                </h4>
                <p>{{ story.story_short }}</p>
            </div>
        </div>
    </div>

</div>

<a class="read_more" href="{% url 'stories:story' %}?id={{ story.id }}">查看全文</a>

{% endfor %}




{#页码#}
<div class="pagenation">
    {% if stories_now.has_previous %}
    <a href="{% url 'stories:index'%}?page={{ stories_now.previous_page_number }}">上一页</a>
    {% endif %}

    {% for index in paginator.page_range %}
    <a {% if index == dishes.number %}class="active" {% endif %}href="{% url 'stories:index'%}?page={{ index }}">{{ index }}</a>
    {% endfor %}

    {% if stories_now.has_next %}
    <a href="{% url 'stories:index'%}?page={{ stories_now.next_page_number }}">下一页</a>
    {% endif %}
</div>



{% endblock body %}